import axios from "@/models/axios"
import type UserModel from "@/models/userInterFace"

export const userLogin = (data: UserModel) => {
    return axios({
        method: "post",
        url: "/api/users/login",
        data
    })
}
export const studentList = () => {
    return axios({
        method: "get",
        url: "/api/users/student",
        headers: {
            token: localStorage.getItem("token"),
        },
    })
}
export const delStudent = (data: any) => {
    return axios({
        method: "post",
        url: "/api/users/del",
        data,
        headers: {
            token: localStorage.getItem("token"),
        },
    })
}
export const studentReg = (data: any) => {
    return axios({
        method: "post",
        url: "/api/users/reg",
        data,
        headers: {
            token: window.localStorage.getItem("token")
        }
    })
}

export const userInsertMany = (data: any) => {
    return axios({
        method: "post",
        url: "/api/users/insertmany",
        data,
        headers: {
            token: window.localStorage.getItem("token")
        }
    })
}